public abstract class Bridge
{
    public static void main(String[] args) {
        Bridge pa = new ProductA();
        Bridge pb = new ProductB();

        pa.setFunc(new FuncA());
        pa.show();
        pa.setFunc(new FuncB());
        pa.show();

        pb.setFunc(new FuncA());
        pb.show();
        pb.setFunc(new FuncB());
        pb.show();
    }
    
	protected IFunc iFunc = null;
	public void setFunc(IFunc ifunc) { this.iFunc = ifunc; }
	public abstract void show();
}
class ProductA extends Bridge
{
    @Override
	public void show()
	{
		System.out.println(("ProductA." + this.iFunc.show()));
	}
}
class ProductB extends Bridge
{
    @Override
	public void show()
	{
		System.out.println(("ProductB." + this.iFunc.show()));
	}
}


interface IFunc { String show(); }

class FuncA implements IFunc
{
	public String show() { return "FuncA.show()"; }
}
class FuncB implements IFunc
{
	public String show() { return "FuncB.show()"; }
}